Unit 4 Exercise 4
Exercise 4: Existing Embedded Script
Objective
To use an existing embedded script to create folders.
Summary
Using the existing schedule called, Embedded Scripts Training, create a Windows Job called, Create Daily Folder. The job should run the script Create_Folder utilizing the Embedded Script Job Action.
Instructions
- In Library > Administration, select Master Schedules.
- In the Schedule list, select Embedded Scripts Training and click the View button.
Create the Embedded Script Job
- Click the Add Job button on the side menu.
- In the Name textbox, enter
Create Daily Folder
. - In the Job Type drop-down list, select Windows.
- In the Machine Selection drop-down list, select SMATraining.
- In the User ID drop-down menu, select SMATRAINING\SMAUSER.
- In the Job Action drop-down list, select Embedded Script.
- In the Script drop-down list, select the Create_Folder.
- Leave the Version as LATEST (X).
- In the Runner drop-down menu, select Command Shell.
- In the Arguments textbox, type the following,
“C:\IT\Backups\[[$SCHEDULE DATEYYYYMM]]”
- Remember to use properties where acceptable
- Click the Save button.
- Click the Lock icon in the upper right-hand corner.
- Scroll to the Frequency sections and ADD a Frequency called
Mon-Fri-N
. - Add Documentation and then click the Save button.
Verify Directory Does NOT Exist
- Outside of OpCon (Using Windows File Explorer) verify that the following folder does not exist in the following path,
“C:\IT\Backups\[[$SCHEDULE DATEYYYYMM]]”
, (where$SCHEDULE DATEYYYYMM
refers to the current month of the current year)
Build Schedule
- Return to Solution Manager and build the Embedded Scripts Training Schedule Released for today.
- Once the Job completes successfully, verify that the folder was created in Windows File Explorer.